<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>珠海梵创科技有限公司</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="robots" content="NOINDEX,NOFOLLOW,noarchive"/>
        <link rel="icon" href="__PUBLIC__/Images/favicon.ico" type="image/x-icon" />
    	<link rel="shortcut icon" href="__PUBLIC__/Images/favicon.ico" type="image/x-icon" />
        <meta name="robots" content="noarchive"/>
        <meta name="robots" content="nofollow"/>
        <TYjs file="jquery.min,jquery.placeholder.min" public="true"/>
        <TYcss file="login"/>

        <TYimport plugin="artdialog" />
        <!-- 下面的Css用来隐藏后台页面的调试div，不遮挡框架页面的调试div -->
        <style type="text/css">
            #think_page_trace,#think_page_trace_open{display:none;}
        </style>
    </head>
    <body>
        <div id="login_box">
            <form id="admin_login" name="login_form" autocomplete="off" action="{:U(MODULE_NAME.'/Public/check_login', '', true, false, true, true)}" method="post">
                <ul class="login_box">
                    <li class="clearFix">
                        <span class="user"></span>
                        <input type="text" name="username" placeholder="管理员账号" value=""/>
                    </li>
                    <li class="clearFix">
                        <span class="pwd"></span>
                        <input type="password" name="password" placeholder="密码" value=""/>
                    </li>
                    <li class="clearFix">
                        <span class="identify"></span>
                        <input type="text" name="verify" maxlength="4" placeholder="验证码" style="width: 100px" />
                        <label class="identify_img"><img src="{:U(MODULE_NAME.'/Verify/get_verify','',true,true)}" /></label>
                    </li>
                    <li class="clearFix">
                        <!-- <a class="back_home" href="http://www.zhfancon.com/home.php">返回前台</a> -->
                        <input type="submit" name="login" value="登录"/>
                    </li>
                </ul>
            </form>
        </div>
    </body>
    <script type="text/javascript">
       if (window.parent != window) {
           window.top.location.href = location.href;
       }

       document.forms['login_form'].elements['username'].focus();

       


       
       $('.identify_img').click(function() {
           $(this).html('<img src="{:U(MODULE_NAME.'/Verify/get_verify','',true,true)}" />');
       });
       
       
       
       $('#admin_login').submit(function() {
           //登陆验证
           var username = $('input[name=username]');
           var pwd = $('input[name=password]');
           var verify = $('input[name=verify]');
           var red = '#FF0000';
           var url = "{:U(MODULE_NAME.'/Public/check_login', '', true, false, true, true)}";
           
	
           if (!username.val().trim()) {
        	  
               //添加红色边框提醒
               username.css('border-color', red).attr('placeholder', '用户名不能为空').focus();
               return false;
           } else if (!pwd.val().trim()) {
        	   
               //清除边框样式
               username.css('border-color', '');
               pwd.css('border-color', 'red').attr('placeholder', '密码不能为空').focus();
               return false;
           } else if (!verify.val().trim()) {
        	   
               username.css('border-color', '');
               pwd.css('border-color', '');
               verify.css('border-color', red).attr('placeholder', '验证码不能为空').focus();
               return false;
           } else {
        	   
               verify.css('border-color', '');
               $.post(url, $(this).serialize(),
                       function(data) {
                           if (data.status > 0) {
                               window.location.reload();
                           } else {
                               art.dialog.tips(data.info, 1.5);
                               verify.val('');
                               $('.identify_img').html('<img src="{:U(MODULE_NAME.'/Verify/get_verify','',true,true)}" />');
                               if (data.status == -2) {
                                   location.reload();
                               }
                           }
                       }, 'json');
               return false;
           }
       });
    </script>
</html>
